package com.songdehuai.motherandchild.manual;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;

import com.songdehuai.motherandchild.R;
import com.songdehuai.motherandchild.ViewPagerAdapter;
import com.songdehuai.motherandchild.manual.fragment.ChildrenFragment;
import com.songdehuai.motherandchild.manual.fragment.InoculationFragment;
import com.songdehuai.motherandchild.manual.fragment.PregnancyFragment;
import com.songdehuai.motherandchild.manual.fragment.PrepregnancyFragment;

import org.xutils.view.annotation.ViewInject;
import org.xutils.x;

public class ManualListActivity extends AppCompatActivity {

    @ViewInject(R.id.manual_vp)
    ViewPager manualVp;
    @ViewInject(R.id.manual_tabs)
    TabLayout manualTab;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_manual);
        x.view().inject(this);
        initViewPager();
    }

    private void initViewPager() {
        ViewPagerAdapter viewPagerAdapter = new ViewPagerAdapter(getSupportFragmentManager());
        viewPagerAdapter.addFrag(new PrepregnancyFragment(), "孕前");
        viewPagerAdapter.addFrag(new PregnancyFragment(), "孕产");
        viewPagerAdapter.addFrag(new ChildrenFragment(), "儿童");
        viewPagerAdapter.addFrag(new InoculationFragment(), "接种");


    }
}
